package com.axend.aerosense.common.adapter;

import com.axend.aerosense.common.R;
import com.axend.aerosense.common.base.ITextItem;
import com.axend.aerosense.common.databinding.CommonItemBinding;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;

import org.jetbrains.annotations.NotNull;


public class CommonListAdapter extends BaseQuickAdapter<ITextItem, BaseDataBindingHolder<CommonItemBinding>> {

    public CommonListAdapter() {
        super(R.layout.common_item);
    }

    @Override
    protected void convert(@NotNull BaseDataBindingHolder<CommonItemBinding> commonItemBindingBaseDataBindingHolder, ITextItem iTextItem) {
        if(null == iTextItem){
            return;
        }
        CommonItemBinding binding = commonItemBindingBaseDataBindingHolder.getDataBinding();
        binding.commonItemRightTxt.setText("+" + iTextItem.getRightText());
        binding.commonItemLeftTxt.setText(iTextItem.getLeftText());
    }

//    @Override
//    protected void convert(@NotNull BaseDataBindingHolder<CommonItemBinding> baseViewHolder, ITextItem iTextItem) {
//        if(null == iTextItem){
//            return;
//        }
//        CommonItemBinding binding = baseViewHolder.getDataBinding();
//        binding.commonItemRightTxt.setText(iTextItem.getRightText());
//        binding.commonItemLeftTxt.setText(iTextItem.getLeftText());
//
//    }

}
